import configparser

# cf = configparser.ConfigParser()
# cf.read('E:/study/autostudy/config/LocalElement.ini')
# print(cf.get('RegisterElement','user_email'))


class Readini():

    def __init__(self,file_name=None,node=None):

        if file_name == None:
            self.file_name = 'E:/study/autostudy/config/LocalElement.ini'

        self.cf = self.load_ini(self.file_name)

        if node==None:
            self.node = 'RegisterElement'
        else:
            self.node = node


    def load_ini(self,file_name):
        cf = configparser.ConfigParser()
        cf.read(file_name)
        return cf


    def get_value(self,key):
        data = self.cf.get(self.node,key)
        return data

if __name__ == '__main__':
   read_init = Readini()
   print(read_init.get_value('user_name'))